<template>
  <div />
</template>

<script setup lang="ts" name="Redirect">
const { currentRoute, replace } = useRouter();
const { params, query } = unref(currentRoute);
const { path } = params;

const _path = Array.isArray(path) ? path.join('/') : path;

// 在路由跳转时动态生成目标路径，并保留查询参数
replace({
  path: '/' + _path,
  query
});
</script>
